package com.yuyue.dronesystem.beans;

import java.util.Objects;

import com.yuyue.dronesystem.enums.BoxType;

/**
 * Drone
 */
public class Drone extends Box {

    // 速度（千米/小时）
    private Double speed;
    // 最大载荷（磅）
    private Double maxLoad;
    // 空载飞行时间（分钟）
    private Double noLoadRuntime;
    // 能视频
    private Boolean isVideo;
    // 能载货
    private Boolean isPackage;
    // 货仓ID
    private Long cargoBayId;

    public Drone() {
    }

    public Drone(Double speed, Double maxLoad, Double noLoadRuntime, Boolean isVideo, Boolean isPackage, Long cargoBayId) {
        this.speed = speed;
        this.maxLoad = maxLoad;
        this.noLoadRuntime = noLoadRuntime;
        this.isVideo = isVideo;
        this.isPackage = isPackage;
        this.cargoBayId = cargoBayId;
    }

    public Drone(Double length, Double width, Double height, Double speed, Double maxLoad, Double noLoadRuntime, Boolean isVideo, Boolean isPackage, Long cargoBayId) {
        super(length, width, height, BoxType.DRONE);
        this.speed = speed;
        this.maxLoad = maxLoad;
        this.noLoadRuntime = noLoadRuntime;
        this.isVideo = isVideo;
        this.isPackage = isPackage;
        this.cargoBayId = cargoBayId;
    }

    public Double getSpeed() {
        return this.speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public Double getMaxLoad() {
        return this.maxLoad;
    }

    public void setMaxLoad(Double maxLoad) {
        this.maxLoad = maxLoad;
    }

    public Double getNoLoadRunTime() {
        return this.noLoadRuntime;
    }

    public void setNoLoadRunTime(Double noLoadRuntime) {
        this.noLoadRuntime = noLoadRuntime;
    }

    public Boolean isIsVideo() {
        return this.isVideo;
    }

    public Boolean getIsVideo() {
        return this.isVideo;
    }

    public void setIsVideo(Boolean isVideo) {
        this.isVideo = isVideo;
    }

    public Boolean isIsPackage() {
        return this.isPackage;
    }

    public Boolean getIsPackage() {
        return this.isPackage;
    }

    public void setIsPackage(Boolean isPackage) {
        this.isPackage = isPackage;
    }

    public Long getCargoBayId() {
        return this.cargoBayId;
    }

    public void setCargoBayId(Long cargoBayId) {
        this.cargoBayId = cargoBayId;
    }

    public Drone speed(Double speed) {
        this.speed = speed;
        return this;
    }

    public Drone maxLoad(Double maxLoad) {
        this.maxLoad = maxLoad;
        return this;
    }

    public Drone noLoadRuntime(Double noLoadRuntime) {
        this.noLoadRuntime = noLoadRuntime;
        return this;
    }

    public Drone isVideo(Boolean isVideo) {
        this.isVideo = isVideo;
        return this;
    }

    public Drone isPackage(Boolean isPackage) {
        this.isPackage = isPackage;
        return this;
    }

    public Drone cargoBayId(Long cargoBayId) {
        this.cargoBayId = cargoBayId;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof Drone)) {
            return false;
        }
        Drone drone = (Drone) o;
        return super.equals((Box) o) && Objects.equals(speed, drone.speed) && Objects.equals(maxLoad, drone.maxLoad) && Objects.equals(noLoadRuntime, drone.noLoadRuntime) && Objects.equals(isVideo, drone.isVideo) && Objects.equals(isPackage, drone.isPackage) && Objects.equals(cargoBayId, drone.cargoBayId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), speed, maxLoad, noLoadRuntime, isVideo, isPackage, cargoBayId);
    }

    @Override
    public String toString() {
        return "{" +
            " box='" + super.toString() + "'" +
            ", speed='" + getSpeed() + "'" +
            ", maxLoad='" + getMaxLoad() + "'" +
            ", noLoadRuntime='" + getNoLoadRunTime() + "'" +
            ", isVideo='" + isIsVideo() + "'" +
            ", isPackage='" + isIsPackage() + "'" +
            ", cargoBayId='" + getCargoBayId() + "'" +
            "}";
    }
}